class LruCache {
  Map<String, dynamic> _cache;

  int size;

  LruCache([this.size = 1000]) {
    _cache = {};
  }

  get(String key) {
    return _cache[key];
  }

  save(String key, value) {
    if (_cache.length > 1000) {
      String _key = _cache.keys.first;
      remove(_key);
    }
    _cache[key] = value;
  }

  remove(String key) {
    _cache.remove(key);
  }
}
